<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body>
<div style="height: 50px"></div>
<div id="exportword_content">
    <style>
        body{overflow-x: hidden}
        .dantab{width: 90%;margin: 0 0 0 5%!important;}
        .dantab td{border-color: #000!important;text-align: center}
        .dantab tr td:nth-child(1){width: 20%}
        .dantab tr td:nth-child(3){width: 20%}
        .dantab tr td:nth-child(2){width: 30%}
        .dantab tr td:nth-child(4){width: 30%}
        #dantit{text-decoration: underline;text-underline-position: under;font-weight: 700;font-size: 24px;text-align: center;padding: 20px;letter-spacing: 12px;}
        #created_at{text-align: right;letter-spacing: 5px;}
        .qianming{max-width: 100px;max-height: 40px}
    </style>
    <table class="layui-table dantab" border="1">
        <tbody>
            <tr><td colspan="4" id="dantit">江西高宏建设集团有限公司费用报销单</td></tr>
            <tr><td colspan="4" id="created_at"></td></tr>
            <tr><td>部门</td><td id="flowdept"></td><td>经办人</td><td id="flowuser"></td></tr>
            <tr><td>用途</td><td colspan="2" id="budid_name"></td><td>附件：<span id="filenums"></span> 张</td></tr>
            <tr><td>摘要</td><td colspan="3" id="zhai"></td></tr>
            <tr><td>收款单位</td><td id="gonger"></td><td>支付方式</td><td id="incdaotype"></td></tr>
            <tr><td>开户银行</td><td id="bankname"></td><td>银行账号</td><td id="banknum"></td></tr>
            <tr><td>付款金额（大写）</td><td colspan="2" id="shenfee_da"></td><td>¥：<span id="shenfee"></span></td></tr>

<!--            <tr>-->
<!--                <td>会计复核：</td>-->
<!--                <td colspan="3" style="text-align: left">-->
<!--                    <div>审核意见：同意报销！</div>-->
<!--                    <div>审核人：张三       <span style="float: right">日期：2024年09月23日</span></div>-->
<!--                    <div>-->
<!--                        <span>审核人：</span>-->
<!--                        <span>张展啥</span>-->
<!--                        <span style="float: right">日期：</span>-->
<!--                        <span style="float: right">日期：2024年09月23日</span>-->
<!--                    </div>-->
<!--                </td>-->
<!--            </tr>-->

        </tbody>
    </table>
</div>
<div style="text-align: center;margin-top: 30px"><button class="layui-btn layui-btn-sm btn-light marginr5" style="background-color: #2272eb" onclick="print_flow_dan()">确认打印</button></div>
<script>
    var param_id = getQueryVariable('id') || 0;
    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_payment_gong_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;

                $("#created_at").text(data.created_at_ymd);
                $("#flowdept").text(data.flowdept);
                $("#flowuser").text(data.flowuser);
                $("#budid_name").text(data.budid_name);
                $("#filenums").text(data.filenums);
                $("#zhai").text(data.zhai);
                $("#gonger").text(data.gonger);
                $("#incdaotype").text(data.incdaotype);
                $("#bankname").text(data.bankname);
                $("#banknum").text(data.banknum);
                $("#shenfee_da").text(data.shenfee_da);
                $("#shenfee").text(data.shenfee);



                var shenlog = res.data.billinfo.shenlog;

                for (var key in shenlog){
                    if(key == 0 && shenlog[key].name == '发起流程'){
                        continue;
                    }
                    var str = '';
                    str += '<tr>';
                    str += ' <td>'+shenlog[key].name+'</td>';
                    str += '<td colspan="3" style="text-align: left">';
                    str += '<div>审核意见：'+shenlog[key].explain+'</div>';

                    str += '<div>';
                    if(shenlog[key].created_user_gang){
                        str += ' <span>'+shenlog[key].created_user_gang+'：</span>';
                    }else{
                        str += ' <span>审核人：</span>';
                    }

                    if(shenlog[key].qian){
                        str += '<img class="qianming" src="'+get_file_complete(shenlog[key].qian)+'" />';
                    }else{
                        str += '<span>'+shenlog[key].created_user+'</span>';
                    }
                    str += '<span style="float: right">日期：'+shenlog[key].created_at+'</span>';
                    str += '</div>';


                    str += '</td>';
                    str += '</tr>';
                    $(".dantab tbody").append(str);
                }


                $(".dantab tbody").append('<tr><td>备注</td><td colspan="3">'+data.explain+'</td></tr>');


                render_from();
            }
        });
    });




    function print_flow_dan(){
        $("#exportword_content").printArea();
    }

</script>
</body>
</html>




